#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

void _bool_print()
{
    bool b;
    cout << "default bool:\t\t" << true << " " << false << endl;
    cout << "alpha bool:\t\t" << boolalpha << true << " " << false << endl;
}

void _int_base()
{
    const int i = 13, j = 1024;
    cout << showbase;
    cout << "default int:\t\t" << i << " " << j << endl;
    cout << "hex int:\t\t" << hex << i << " " << j << endl;
    cout << "oct int:\t\t" << oct << i << " " << j << endl;
    cout << "bin int:\t\t" << bitset<8>(i) << " " << bitset<16>(j) << endl;
    cout << "dec int:\t\t" << dec << i << " " << j << endl;
    cout << noshowbase;
}

void _float_point()
{
    float f = 10.0;
    cout << "default float:\t\t" << f << endl;
    cout << "show point:\t\t"
         << showpoint
         << f << endl
         << noshowpoint;
}

void _pos_neg()
{
    float f = 10.0;
    cout << "no pos:  \t\t" << noshowpos << f << " " << -f << endl;
    cout << "show pos:\t\t" << showpos << f << " " << -f << endl;
}

void _column()
{
    int i = -16;
    double d = 3.14159;
    cout << "i: " << setw(12) << i << "next column" << '\n'
         << "d: " << setw(12) << d << "next column" << '\n';
    cout << left
         << "i: " << setw(12) << i << "next column" << '\n'
         << "d: " << setw(12) << d << "next column" << '\n';
    cout << right
         << "i: " << setw(12) << i << "next column" << '\n'
         << "d: " << setw(12) << d << "next column" << '\n';
    cout << internal
         << "i: " << setw(12) << i << "next column" << '\n'
         << "d: " << setw(12) << d << "next column" << '\n';
    cout << right
         << std::setfill('#')
         << "i: " << setw(12) << i << "next column" << '\n'
         << "d: " << setw(12) << d << "next column" << '\n'
         << setfill(' ');
}

void _refresh()
{
    cout << "hi!" << endl;
    cout << "hi!" << flush;
    cout << "hi!" << ends;
}
int main()
{
    _bool_print();
    cout << "---" << endl;
    _int_base();
    cout << "---" << endl;
    _float_point();
    cout << "---" << endl;
    _pos_neg();
    cout << "---" << endl;
    _column();
    cout << "---" << endl;
    _refresh();
}